//
//  ZYNTableViewCellForListDetail.m
//  VideoPic
//
//  Created by dllo on 16/3/29.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZYNTableViewCellForListDetail.h"
#import "ZYNModelForSongList.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@interface ZYNTableViewCellForListDetail()
@property (nonatomic, strong) UILabel *labelForSongName;
@property (nonatomic, strong) UILabel *labelForSingerName;
@end
@implementation ZYNTableViewCellForListDetail

#pragma mark - init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

#pragma mark - createSubViews
- (void)createSubViews {
    //cell style
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.labelForCurrentSongIndex = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelForCurrentSongIndex];
    
    self.labelForSongName = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelForSongName];
    
    self.labelForSingerName = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelForSingerName];
    
}

#pragma mark - layout
- (void)layoutSubviews {
    [super layoutSubviews];
    self.labelForCurrentSongIndex.frame = CGRectMake(10, 10, WIDTH / 14, WIDTH / 14);
    
    
    self.labelForSongName.frame = CGRectMake(10 + WIDTH / 10 + 10, 5, WIDTH - WIDTH / 6 - 70,  (HEIGHT - 15) / 2 );
    
    self.labelForSingerName.frame = CGRectMake(10 + WIDTH / 10 + 10, (HEIGHT - 15) / 2 + 5 + 5, WIDTH / 2, (HEIGHT - 15) / 2);
    
}

#pragma mark - deliverModel
- (void)passSongListModel:(ZYNModelForSongList *)model {
    
    self.labelForSongName.text = model.name;
    self.labelForSingerName.text = model.singerName;
    
    self.labelForCurrentSongIndex.font = [UIFont systemFontOfSize:14];
    self.labelForSongName.font = [UIFont systemFontOfSize:14];
    self.labelForSingerName.font = [UIFont systemFontOfSize:12];
    
    self.labelForCurrentSongIndex.textColor = [UIColor whiteColor];
    self.labelForSongName.textColor = [UIColor whiteColor];
    self.labelForSingerName.textColor = [UIColor whiteColor];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
